SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for data_upload_record
-- ----------------------------
DROP TABLE IF EXISTS `data_upload_record`;
CREATE TABLE `data_upload_record` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `file_name` varchar(255)   NOT NULL COMMENT '文件名',
  `file_path` varchar(500)   NOT NULL COMMENT '文件路径',
  `file_size` bigint DEFAULT NULL COMMENT '文件大小（字节）',
  `upload_user_id` bigint DEFAULT NULL COMMENT '上传用户ID',
  `upload_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '上传时间',
  `data_type` varchar(50)   DEFAULT NULL COMMENT '数据类型：income-收入信息，identity-身份信息，platform-平台信息',
  `total_count` int DEFAULT '0' COMMENT '总记录数',
  `success_count` int DEFAULT '0' COMMENT '成功导入数',
  `fail_count` int DEFAULT '0' COMMENT '失败导入数',
  `status` tinyint DEFAULT '0' COMMENT '状态：0-处理中，1-处理成功，2-处理失败',
  `error_message` longtext   COMMENT '错误信息',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint DEFAULT '0' COMMENT '是否删除：0-否，1-是',
  PRIMARY KEY (`id`),
  KEY `idx_data_upload_record_status` (`status`)
) ENGINE=InnoDB  COMMENT='数据上传记录表';

-- ----------------------------
-- Records of data_upload_record
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `menu_name` varchar(100)   NOT NULL COMMENT '菜单名称',
  `menu_code` varchar(100)   NOT NULL COMMENT '菜单编码',
  `type` tinyint NOT NULL COMMENT '菜单类型：1-目录，2-菜单，3-按钮',
  `path` varchar(200)   DEFAULT NULL COMMENT '菜单路径',
  `component` varchar(200)   DEFAULT NULL COMMENT '组件路径',
  `icon` varchar(100)   DEFAULT NULL COMMENT '菜单图标',
  `parent_id` bigint DEFAULT NULL COMMENT '父级菜单ID',
  `sort` int DEFAULT '0' COMMENT '排序',
  `status` tinyint DEFAULT '1' COMMENT '状态：0-禁用，1-启用',
  `visible` tinyint DEFAULT '1' COMMENT '是否显示：0-隐藏，1-显示',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint DEFAULT '0' COMMENT '是否删除：0-否，1-是',
  PRIMARY KEY (`id`),
  UNIQUE KEY `menu_code` (`menu_code`),
  KEY `idx_sys_menu_code` (`menu_code`),
  KEY `idx_sys_menu_parent_id` (`parent_id`),
  KEY `idx_sys_menu_status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=15  COMMENT='系统菜单表';

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu` (`id`, `menu_name`, `menu_code`, `type`, `path`, `component`, `icon`, `parent_id`, `sort`, `status`, `visible`, `create_time`, `update_time`, `deleted`) VALUES (1, '主面板', 'dashboard', 2, '/dashboard', 'Dashboard', 'House', NULL, 1, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_menu` (`id`, `menu_name`, `menu_code`, `type`, `path`, `component`, `icon`, `parent_id`, `sort`, `status`, `visible`, `create_time`, `update_time`, `deleted`) VALUES (2, '数据导入', 'upload', 2, '/upload', 'DataUpload', 'Upload', NULL, 2, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_menu` (`id`, `menu_name`, `menu_code`, `type`, `path`, `component`, `icon`, `parent_id`, `sort`, `status`, `visible`, `create_time`, `update_time`, `deleted`) VALUES (3, '税务报送', 'report', 2, '/report', 'TaxReport', 'Document', NULL, 3, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_menu` (`id`, `menu_name`, `menu_code`, `type`, `path`, `component`, `icon`, `parent_id`, `sort`, `status`, `visible`, `create_time`, `update_time`, `deleted`) VALUES (4, '系统日志', 'logs', 2, '/logs', 'SystemLogs', 'List', NULL, 4, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_menu` (`id`, `menu_name`, `menu_code`, `type`, `path`, `component`, `icon`, `parent_id`, `sort`, `status`, `visible`, `create_time`, `update_time`, `deleted`) VALUES (5, '报送数据管理', 'data', 2, '/tax-management', 'TaxManagement', 'Setting', NULL, 2, 1, 1, '2025-08-26 09:38:56', '2025-08-28 03:15:44', 0);
INSERT INTO `sys_menu` (`id`, `menu_name`, `menu_code`, `type`, `path`, `component`, `icon`, `parent_id`, `sort`, `status`, `visible`, `create_time`, `update_time`, `deleted`) VALUES (10, '系统管理', 'system', 1, '', '', 'Setting', NULL, 10, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_menu` (`id`, `menu_name`, `menu_code`, `type`, `path`, `component`, `icon`, `parent_id`, `sort`, `status`, `visible`, `create_time`, `update_time`, `deleted`) VALUES (11, '用户管理', 'user', 2, '/users', 'UserManagement', 'User', 10, 1, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_menu` (`id`, `menu_name`, `menu_code`, `type`, `path`, `component`, `icon`, `parent_id`, `sort`, `status`, `visible`, `create_time`, `update_time`, `deleted`) VALUES (12, '角色管理', 'role', 2, '/roles', 'RoleManagement', 'User', 10, 2, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_menu` (`id`, `menu_name`, `menu_code`, `type`, `path`, `component`, `icon`, `parent_id`, `sort`, `status`, `visible`, `create_time`, `update_time`, `deleted`) VALUES (13, '权限管理', 'permission', 2, '/permissions', 'PermissionManagement', 'Lock', 10, 3, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_menu` (`id`, `menu_name`, `menu_code`, `type`, `path`, `component`, `icon`, `parent_id`, `sort`, `status`, `visible`, `create_time`, `update_time`, `deleted`) VALUES (14, '菜单管理', 'menu', 2, '/menus', 'MenuManagement', 'MenuIcon', 10, 4, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
COMMIT;

-- ----------------------------
-- Table structure for sys_operation_log
-- ----------------------------
DROP TABLE IF EXISTS `sys_operation_log`;
CREATE TABLE `sys_operation_log` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` bigint DEFAULT NULL COMMENT '操作用户ID',
  `username` varchar(50)   DEFAULT NULL COMMENT '用户名',
  `operation` varchar(100)   DEFAULT NULL COMMENT '操作类型',
  `method` varchar(200)   DEFAULT NULL COMMENT '请求方法',
  `params` text   COMMENT '请求参数',
  `ip` varchar(50)   DEFAULT NULL COMMENT 'IP地址',
  `user_agent` varchar(500)   DEFAULT NULL COMMENT '用户代理',
  `execution_time` bigint DEFAULT NULL COMMENT '执行时间（毫秒）',
  `status` tinyint DEFAULT NULL COMMENT '状态：0-失败，1-成功',
  `error_message` text   COMMENT '错误信息',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `idx_sys_operation_log_create_time` (`create_time`)
) ENGINE=InnoDB  COMMENT='系统操作日志表';

-- ----------------------------
-- Records of sys_operation_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_permission`;
CREATE TABLE `sys_permission` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `permission_name` varchar(100)   NOT NULL COMMENT '权限名称',
  `permission_code` varchar(100)   NOT NULL COMMENT '权限编码',
  `type` tinyint NOT NULL COMMENT '权限类型：1-模块，2-按钮，3-接口',
  `path` varchar(200)   DEFAULT NULL COMMENT '权限路径',
  `description` varchar(200)   DEFAULT NULL COMMENT '权限描述',
  `parent_id` bigint DEFAULT NULL COMMENT '父级权限ID',
  `sort` int DEFAULT '0' COMMENT '排序',
  `status` tinyint DEFAULT '1' COMMENT '状态：0-禁用，1-启用',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint DEFAULT '0' COMMENT '是否删除：0-否，1-是',
  PRIMARY KEY (`id`),
  UNIQUE KEY `permission_code` (`permission_code`),
  KEY `idx_sys_permission_code` (`permission_code`),
  KEY `idx_sys_permission_parent_id` (`parent_id`),
  KEY `idx_sys_permission_status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=28  COMMENT='系统权限表';

-- ----------------------------
-- Records of sys_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (1, '用户管理', 'user:manage', 1, '/users', '用户管理模块', NULL, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (2, '用户查看', 'user:view', 3, '/users/list', '查看用户列表', 1, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (3, '用户创建', 'user:create', 3, '/users/create', '创建用户', 1, 2, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (4, '用户编辑', 'user:edit', 3, '/users/edit', '编辑用户', 1, 3, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (5, '用户删除', 'user:delete', 3, '/users/delete', '删除用户', 1, 4, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (6, '角色管理', 'role:manage', 1, '/roles', '角色管理模块', NULL, 2, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (7, '角色查看', 'role:view', 3, '/roles/list', '查看角色列表', 6, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (8, '角色创建', 'role:create', 3, '/roles/create', '创建角色', 6, 2, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (9, '角色编辑', 'role:edit', 3, '/roles/edit', '编辑角色', 6, 3, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (10, '角色删除', 'role:delete', 3, '/roles/delete', '删除角色', 6, 4, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (11, '权限管理', 'permission:manage', 1, '/permissions', '权限管理模块', NULL, 3, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (12, '权限查看', 'permission:view', 3, '/permissions/list', '查看权限列表', 11, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (13, '权限创建', 'permission:create', 3, '/permissions/create', '创建权限', 11, 2, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (14, '权限编辑', 'permission:edit', 3, '/permissions/edit', '编辑权限', 11, 3, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (15, '权限删除', 'permission:delete', 3, '/permissions/delete', '删除权限', 11, 4, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (16, '菜单管理', 'menu:manage', 1, '/menus', '菜单管理模块', NULL, 4, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (17, '菜单查看', 'menu:view', 3, '/menus/list', '查看菜单列表', 16, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (18, '菜单创建', 'menu:create', 3, '/menus/create', '创建菜单', 16, 2, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (19, '菜单编辑', 'menu:edit', 3, '/menus/edit', '编辑菜单', 16, 3, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (20, '菜单删除', 'menu:delete', 3, '/menus/delete', '删除菜单', 16, 4, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (21, '系统管理', 'system:manage', 1, '/system', '系统管理模块', NULL, 5, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (22, '系统配置', 'system:config', 3, '/system/config', '系统配置', 21, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (23, '系统监控', 'system:monitor', 3, '/system/monitor', '系统监控', 21, 2, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (24, '数据管理', 'data:manage', 1, '/data', '数据管理模块', NULL, 6, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (25, '数据导入', 'data:import', 3, '/data/import', '数据导入', 24, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (26, '数据导出', 'data:export', 3, '/data/export', '数据导出', 24, 2, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_permission` (`id`, `permission_name`, `permission_code`, `type`, `path`, `description`, `parent_id`, `sort`, `status`, `create_time`, `update_time`, `deleted`) VALUES (27, '数据查看', 'data:view', 3, '/data/view', '数据查看', 24, 3, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `role_name` varchar(50)   NOT NULL COMMENT '角色名称',
  `role_code` varchar(50)   NOT NULL COMMENT '角色编码',
  `description` varchar(200)   DEFAULT NULL COMMENT '角色描述',
  `status` tinyint DEFAULT '1' COMMENT '状态：0-禁用，1-启用',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint DEFAULT '0' COMMENT '是否删除：0-否，1-是',
  `sort` int DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`id`),
  UNIQUE KEY `role_code` (`role_code`)
) ENGINE=InnoDB AUTO_INCREMENT=3  COMMENT='系统角色表';

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` (`id`, `role_name`, `role_code`, `description`, `status`, `create_time`, `update_time`, `deleted`, `sort`) VALUES (1, '系统管理员', 'ADMIN', '系统管理员，拥有所有权限', 1, '2025-08-27 00:59:11', '2025-08-27 00:59:11', 0, 0);
INSERT INTO `sys_role` (`id`, `role_name`, `role_code`, `description`, `status`, `create_time`, `update_time`, `deleted`, `sort`) VALUES (2, '普通用户', 'USER', '普通用户，只能查看和上传数据', 1, '2025-08-27 00:59:11', '2025-08-27 00:59:11', 0, 1);
COMMIT;

-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `role_id` bigint NOT NULL COMMENT '角色ID',
  `menu_id` bigint NOT NULL COMMENT '菜单ID',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint DEFAULT '0' COMMENT '是否删除：0-否，1-是',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_role_menu` (`role_id`,`menu_id`),
  KEY `idx_sys_role_menu_role_id` (`role_id`),
  KEY `idx_sys_role_menu_menu_id` (`menu_id`)
) ENGINE=InnoDB AUTO_INCREMENT=24  COMMENT='角色菜单关联表';

-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (1, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (2, 1, 2, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (3, 1, 3, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (4, 1, 4, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (5, 1, 5, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (6, 1, 10, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (7, 1, 11, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (8, 1, 12, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (9, 1, 13, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (10, 1, 14, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (11, 2, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (12, 2, 2, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (13, 2, 3, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (14, 2, 4, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (15, 2, 10, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (16, 2, 11, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (17, 2, 12, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (18, 2, 13, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (19, 2, 14, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (20, 3, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (21, 3, 2, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (22, 3, 3, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_menu` (`id`, `role_id`, `menu_id`, `create_time`, `update_time`, `deleted`) VALUES (23, 3, 4, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
COMMIT;

-- ----------------------------
-- Table structure for sys_role_permission
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_permission`;
CREATE TABLE `sys_role_permission` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `role_id` bigint NOT NULL COMMENT '角色ID',
  `permission_id` bigint NOT NULL COMMENT '权限ID',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint DEFAULT '0' COMMENT '是否删除：0-否，1-是',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_role_permission` (`role_id`,`permission_id`),
  KEY `idx_sys_role_permission_role_id` (`role_id`),
  KEY `idx_sys_role_permission_permission_id` (`permission_id`)
) ENGINE=InnoDB AUTO_INCREMENT=56  COMMENT='角色权限关联表';

-- ----------------------------
-- Records of sys_role_permission
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (1, 1, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (2, 1, 2, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (3, 1, 3, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (4, 1, 4, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (5, 1, 5, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (6, 1, 6, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (7, 1, 7, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (8, 1, 8, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (9, 1, 9, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (10, 1, 10, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (11, 1, 11, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (12, 1, 12, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (13, 1, 13, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (14, 1, 14, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (15, 1, 15, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (16, 1, 16, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (17, 1, 17, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (18, 1, 18, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (19, 1, 19, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (20, 1, 20, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (21, 1, 21, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (22, 1, 22, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (23, 1, 23, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (24, 1, 24, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (25, 1, 25, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (26, 1, 26, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (27, 1, 27, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (28, 2, 1, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (29, 2, 2, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (30, 2, 3, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (31, 2, 4, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (32, 2, 5, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (33, 2, 6, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (34, 2, 7, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (35, 2, 8, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (36, 2, 9, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (37, 2, 10, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (38, 2, 11, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (39, 2, 12, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (40, 2, 13, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (41, 2, 14, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (42, 2, 15, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (43, 2, 16, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (44, 2, 17, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (45, 2, 18, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (46, 2, 19, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (47, 2, 20, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (48, 2, 24, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (49, 2, 25, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (50, 2, 26, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (51, 2, 27, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (52, 3, 24, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (53, 3, 25, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (54, 3, 26, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
INSERT INTO `sys_role_permission` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `deleted`) VALUES (55, 3, 27, '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `username` varchar(50)   NOT NULL COMMENT '用户名',
  `password` varchar(255)   NOT NULL COMMENT '密码',
  `real_name` varchar(100)   DEFAULT NULL COMMENT '真实姓名',
  `email` varchar(100)   DEFAULT NULL COMMENT '邮箱',
  `phone` varchar(20)   DEFAULT NULL COMMENT '手机号',
  `status` tinyint DEFAULT '1' COMMENT '状态：0-禁用，1-启用',
  `avatar` varchar(500)   DEFAULT NULL COMMENT '头像',
  `last_login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
  `last_login_ip` varchar(50)   DEFAULT NULL COMMENT '最后登录IP',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint DEFAULT '0' COMMENT '是否删除：0-否，1-是',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2  COMMENT='系统用户表';

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` (`id`, `username`, `password`, `real_name`, `email`, `phone`, `status`, `avatar`, `last_login_time`, `last_login_ip`, `create_time`, `update_time`, `deleted`) VALUES (1, 'admin', '$2a$10$T6ZGU5tVV8HiE4dbGW901.m2zlLeOMXIRVwFeYoBL.j/gXRoiaoVm', '系统管理员', 'admin@taxx.com', '13800138000', 1, NULL, '2025-08-27 08:59:28', '0:0:0:0:0:0:0:1', '2025-08-26 09:38:56', '2025-08-26 09:38:56', 0);
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` bigint NOT NULL COMMENT '用户ID',
  `role_id` bigint NOT NULL COMMENT '角色ID',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint DEFAULT '0' COMMENT '是否删除：0-否，1-是',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uk_user_role` (`user_id`,`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2  COMMENT='用户角色关联表';

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` (`id`, `user_id`, `role_id`, `create_time`, `update_time`, `deleted`) VALUES (1, 1, 1, '2025-08-27 00:57:30', '2025-08-27 00:57:30', 0);
COMMIT;

-- ----------------------------
-- Table structure for tax_api_log
-- ----------------------------
DROP TABLE IF EXISTS `tax_api_log`;
CREATE TABLE `tax_api_log` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `api_name` varchar(100)   DEFAULT NULL COMMENT '接口名称',
  `api_url` varchar(500)   DEFAULT NULL COMMENT '接口地址',
  `request_method` varchar(10)   DEFAULT NULL COMMENT '请求方法：GET, POST, PUT, DELETE',
  `request_headers` text   COMMENT '请求头',
  `request_body` text   COMMENT '请求体',
  `response_code` int DEFAULT NULL COMMENT '响应状态码',
  `response_headers` text   COMMENT '响应头',
  `response_body` text   COMMENT '响应体',
  `execution_time` bigint DEFAULT NULL COMMENT '执行时间（毫秒）',
  `status` tinyint DEFAULT NULL COMMENT '状态：0-失败，1-成功',
  `error_message` text   COMMENT '错误信息',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `idx_tax_api_log_create_time` (`create_time`)
) ENGINE=InnoDB  COMMENT='税务报送接口调用日志表';

-- ----------------------------
-- Records of tax_api_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for tax_identity_report
-- ----------------------------
DROP TABLE IF EXISTS `tax_identity_report`;
CREATE TABLE `tax_identity_report` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `has_registration` tinyint DEFAULT NULL COMMENT '否办理市场主体登记：0-否，1-是',
  `credit_code` varchar(100)   DEFAULT NULL COMMENT '统一社会信用代码',
  `taxpayer_name` varchar(200)   DEFAULT NULL COMMENT '纳税人名称',
  `detailed_address` text   COMMENT '详细地址',
  `merchant_id` varchar(100)   DEFAULT NULL COMMENT '商户ID',
  `merchant_name` varchar(200)   DEFAULT NULL COMMENT '商户名称',
  `website` varchar(500)   DEFAULT NULL COMMENT '网址',
  `contact_person` varchar(100)   DEFAULT NULL COMMENT '联系人',
  `contact_phone` varchar(20)   DEFAULT NULL COMMENT '联系电话',
  `business_start_time` date DEFAULT NULL COMMENT '经营开始时间',
  `operation_type_code` varchar(10)   DEFAULT NULL COMMENT '操作类型代码',
  `professional_service_identifier` varchar(100)   DEFAULT NULL COMMENT '专业服务机构标识',
  `settlement_account_info` text   COMMENT '结算账户信息',
  `report_status` tinyint DEFAULT '0' COMMENT '报送状态：0-待报送，1-报送中，2-报送成功，3-报送失败',
  `report_time` datetime DEFAULT NULL COMMENT '报送时间',
  `report_message` text   COMMENT '报送结果消息',
  `batch_code` varchar(10)  DEFAULT NULL COMMENT '批次号',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint DEFAULT '0' COMMENT '是否删除：0-否，1-是',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_credit_code` (`credit_code`,`batch_code`) USING BTREE,
  KEY `idx_tax_identity_report_status` (`report_status`),
  KEY `idx_credit_code` (`credit_code`)
) ENGINE=InnoDB  COMMENT='平台内的经营者和从业人员身份信息报送表';

-- ----------------------------
-- Records of tax_identity_report
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for tax_income_report
-- ----------------------------
DROP TABLE IF EXISTS `tax_income_report`;
CREATE TABLE `tax_income_report` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `start_time` varchar(20)   DEFAULT NULL COMMENT '收入所属期起',
  `end_time` varchar(20)   DEFAULT NULL COMMENT '收入所属期止',
  `has_registration` tinyint DEFAULT NULL COMMENT '否办理市场主体登记：0-否，1-是',
  `credit_code` varchar(100)   DEFAULT NULL COMMENT '统一社会信用代码',
  `taxpayer_name` varchar(200)   DEFAULT NULL COMMENT '纳税人名称',
  `merchant_id` varchar(100)   DEFAULT NULL COMMENT '商户ID',
  `merchant_name` varchar(200)   DEFAULT NULL COMMENT '商户名称',
  `goods_income` decimal(20,2) DEFAULT '0.00' COMMENT '收入总额（已取得登记证照的销售货物取得的收入）',
  `goods_refund` decimal(20,2) DEFAULT '0.00' COMMENT '退款金额（已取得登记证照的销售货物取得的收入）',
  `intangible_income` decimal(20,2) DEFAULT '0.00' COMMENT '收入总额（已取得登记证照的销售无形资产取得的收入）',
  `intangible_refund` decimal(20,2) DEFAULT '0.00' COMMENT '退款金额（已取得登记证照的销售无形资产取得的收入）',
  `service_income` decimal(20,2) DEFAULT '0.00' COMMENT '收入总额（已取得登记证照的销售服务取得的收入）',
  `service_refund` decimal(20,2) DEFAULT '0.00' COMMENT '退款金额（已取得登记证照的销售服务取得的收入）',
  `unregistered_income` decimal(20,2) DEFAULT '0.00' COMMENT '收入总额（未取得登记证照）',
  `unregistered_refund` decimal(20,2) DEFAULT '0.00' COMMENT '退款金额（未取得登记证照）',
  `net_income_goods` decimal(20,2) DEFAULT '0.00' COMMENT '收入净额销售货物（未取得登记证照）',
  `net_income_transport` decimal(20,2) DEFAULT '0.00' COMMENT '收入净额货物运输服务（未取得登记证照）',
  `net_income_labor` decimal(20,2) DEFAULT '0.00' COMMENT '收入净额劳务报酬（未取得登记证照）',
  `net_income_royalty` decimal(20,2) DEFAULT '0.00' COMMENT '收入净额稿酬（未取得登记证照）',
  `net_income_franchise` decimal(20,2) DEFAULT '0.00' COMMENT '收入净额特许权使用费（未取得登记证照）',
  `other_net_income` decimal(20,2) DEFAULT '0.00' COMMENT '从事其他网络交易活动取得的收入（净额）',
  `platform_commission` decimal(20,2) DEFAULT '0.00' COMMENT '支付给平台的佣金、服务费合计金额',
  `transaction_count` int DEFAULT '0' COMMENT '交易（订单）数量（笔）',
  `report_status` tinyint DEFAULT '0' COMMENT '报送状态：0-待报送，1-报送中，2-报送成功，3-报送失败',
  `report_time` datetime DEFAULT NULL COMMENT '报送时间',
  `report_message` text   COMMENT '报送结果消息',
  `batch_code` varchar(10)  DEFAULT NULL COMMENT '批次号',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint DEFAULT '0' COMMENT '是否删除：0-否，1-是',
  PRIMARY KEY (`id`),
  KEY `idx_tax_income_report_status` (`report_status`),
  KEY `idx_credit_code` (`credit_code`)
) ENGINE=InnoDB  COMMENT='平台内的经营者和从业人员收入信息报送表';

-- ----------------------------
-- Records of tax_income_report
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for tax_platform_report
-- ----------------------------
DROP TABLE IF EXISTS `tax_platform_report`;
CREATE TABLE `tax_platform_report` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `taxpayer_name` varchar(200)   DEFAULT NULL COMMENT '纳税人名称',
  `credit_code` varchar(100)   DEFAULT NULL COMMENT '统一社会信用代码',
  `platform_name` varchar(200)   DEFAULT NULL COMMENT '平台名称',
  `platform_id` varchar(100)   DEFAULT NULL COMMENT '平台ID',
  `business_start_time` date NOT NULL COMMENT '经营开始时间',
  `business_exit_time` date DEFAULT NULL COMMENT '经营退出时间',
  `operation_type_code` varchar(10)   DEFAULT NULL COMMENT '操作类型代码',
  `report_status` tinyint DEFAULT '0' COMMENT '报送状态：0-待报送，1-报送中，2-报送成功，3-报送失败',
  `report_time` datetime DEFAULT NULL COMMENT '报送时间',
  `report_message` text   COMMENT '报送结果消息',
  `batch_code` varchar(10)  DEFAULT NULL COMMENT '批次号',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` tinyint DEFAULT '0' COMMENT '是否删除：0-否，1-是',
  PRIMARY KEY (`id`),
  UNIQUE KEY `uni_credit_code` (`credit_code`,`batch_code`) USING BTREE,
  KEY `idx_tax_platform_report_status` (`report_status`),
  KEY `idx_credit_code` (`credit_code`)
) ENGINE=InnoDB  COMMENT='平台内的平台企业身份信息报送表';

-- ----------------------------
-- Records of tax_platform_report
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
